<?php
/**
 * @author Adam Zivner <adam.zivner@gmail.com>
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD license
 * @package AttoMVC https://code.google.com/p/attomvc/
 */

class AttoModelLoader {
	protected static $instance = false;

	public function __get($name)
	{
		$class_name = ctype_lower($name[0]) ? (strtolower($name[0]) . substr($name, 1)) : $name;
		$class_name = ucfirst($class_name) . "Model";

		return new $class_name($this);
	}

	public static function getInstance()
	{
		if(self::$instance == false)
			self::$instance = new self;

		return self::$instance;
	}
}